package metier;

import java.io.Serializable;
import java.util.ArrayList;

import metier.Candidature;
import metier.Stage;

public class Entreprise implements Serializable {
	
	private static final long serialVersionUID = 6190919002365605842L;
	
	private int reference = -1;
	private String nom;
	private String login = "Entreprise";
	private String mdp = "123";
	private ArrayList<Stage> listeStages = new ArrayList<Stage>();
	
	public Entreprise(int ref, String nom)
	{
		this.reference = ref;
		this.nom = nom;
	}
	
	public Entreprise(int ref, String nom, String login, String mdp)
	{
		this.reference = ref;
		this.nom = nom;
		this.login = login;
		this.mdp = mdp;
	}
	
	public Entreprise(String nom)
	{
		this.nom = nom;
	}
	
	public Entreprise()
	{
		
	}
	
	public void proposerStage(Stage stage)
	{
		listeStages.add(stage);
	}
	
	public void annulerStage(Stage stage)
	{
		listeStages.remove(stage);
	}
	
	public boolean validerCandidature(Candidature candidature)
	{
		candidature.setValideEntreprise(true);
		return true;
	}

	public void setReference(int reference) {
		this.reference = reference;
	}

	public int getReference() {
		return reference;
	}
	
	public String getLogin() {
		return login;
	}
	
	public void setLogin(String login) {
		this.login = login;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getNom() {
		return nom;
	}
	
	public String getMdp() {
		return mdp;
	}
	
	public void setMdp(String mdp) {
		this.mdp = mdp;
	}
	
	@Override
	public String toString() 
	{
		return "Entreprise [ ref = " + reference + ", nom = " + nom + " ]";
	}
}
